#!/usr/bin/env python
import sys
from datetime import datetime, timedelta
try:
    jday_orig = sys.argv[1]
    add_days = sys.argv[2]

    year = int(jday_orig[0:4])
    days = int(jday_orig[4:7]) - 1 + int(add_days)

    date_result = datetime(year, 1, 1) + timedelta(days=days)

    print date_result.strftime("%Y%j")
except:
    print "Usage: jday_change jday_orig  add_days"
    sys.exit(1)

sys.exit(0)
